[#import "/framework/JGP.htm"  as JGP]
<!--
项目   Bsm
作者   fdp
时间   2018/7/23
-->
[@JGP.head "Title"/]
[@JGP.body]

<input type="hidden" id="id"  value="${meetingID}">

<jgp-div  _row="['8','*','*']" _aux="true">
    <jgp-div slot="1-1" _col="['*','*','*']" _aux="false" >
        <jgp-query slot="1-1"  _target="gridLists" _id="query" _auto="false" _page_size="5">
            <jgp-text   _col="4" _placeholder="人员搜索" _name="name" ></jgp-text>
            <jgp-text   _col="4" _placeholder="单位搜索" _name="workUnit" ></jgp-text>
            <jgp-btn  _fn="search" _margin="5" _icon="search">搜索</jgp-btn>
        </jgp-query>

    </jgp-div>

    <jgp-grid  _id="gridLists" slot="2-1"
               _index="true" _check="true"></jgp-grid>
    <jgp-btn slot="3-1" _fn="checkedUsers" _margin="5" >确认勾选</jgp-btn>
</jgp-div>

[/@JGP.body]

[@JGP.foot]
<script>

    //页面渲染完成之后调用,列表初始化
    JGP.$onload(search())
    //手动搜索
    function search() {
        var meetingID = '${meetingID}';

        JGP.query('query').searchTo('/glMeeting/participantsApiController/queryLastUsers/'+meetingID,function () {
        },function () {
        });
    }

    //确认勾选
    function  checkedUsers() {
        var meetingID = '${meetingID}';
        var users=JGP.grid('gridLists').getSelected();//不是users对象
        	var usersID = new Array();
         for (var i=0;i<users.length;i++) {
             usersID.push(users[i].id)
         }
         usersID=usersID+"";
    JGP.$post('/glMeeting/meetingParticipantsRelationApiController/addJoinUsers',{usersID:usersID,meetingID:meetingID},function (res) {
        JGP.$alert("添加成功");
        JGP.$close(res.flag);
    })
    }





</script>
[/@JGP.foot]